package m.store.util;

import m.html.element.attr.TagColor;
import m.store.model.*;

import java.util.HashMap;
import java.util.Map;

public class ColorUtil {
    private static Map<String, TagColor> orderStatusMap=null;
    public static Map<String, TagColor> getOrderStatus(){
        if(null==orderStatusMap){
            orderStatusMap=new HashMap<>();
            orderStatusMap.put(OrderModel.Status_Register,TagColor.Processing);
            orderStatusMap.put(OrderModel.Status_Confirm,TagColor.Warning);
            orderStatusMap.put(OrderModel.Status_Check,TagColor.Warning);
            orderStatusMap.put(OrderModel.Status_Done,TagColor.Success);
        }
        return orderStatusMap;
    }
    private static Map<String, TagColor> repositoryCheckStatusMap=null;
    public static Map<String, TagColor> getRepositoryCheckStatus(){
        if(null==repositoryCheckStatusMap){
            repositoryCheckStatusMap=new HashMap<>();
            repositoryCheckStatusMap.put(OrderRepositoryCheck.Status_Check,TagColor.Processing);
            repositoryCheckStatusMap.put(OrderRepositoryCheck.Status_Yes,TagColor.Success);
            repositoryCheckStatusMap.put(OrderRepositoryCheck.Status_No,TagColor.Warning);
            repositoryCheckStatusMap.put(OrderRepositoryCheck.Status_View,TagColor.Default);
        }
        return repositoryCheckStatusMap;
    }
    private static Map<String, TagColor> orderTypeMap=null;
    public static Map<String, TagColor> getOrderType(){
        if(null==orderTypeMap){
            orderTypeMap=new HashMap<>();
            orderTypeMap.put(OrderRepositoryCheck.OrderType_Sale,TagColor.Warning);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_Stock,TagColor.Processing);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_StockRefund,TagColor.Warning);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_SaleRefund,TagColor.Processing);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_CountSale,TagColor.Warning);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_CountStock,TagColor.Processing);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_ProduceSale,TagColor.Warning);
            orderTypeMap.put(OrderRepositoryCheck.OrderType_ProduceStock,TagColor.Processing);
        }
        return orderTypeMap;
    }
    private static Map<String, TagColor> noticeTypeMap=null;
    public static Map<String, TagColor> getNoticeType(){
        if(null==noticeTypeMap){
            noticeTypeMap=new HashMap<>();
            noticeTypeMap.put(GoodsRecordNotice.Type_Refund_Sale,TagColor.Warning);
            noticeTypeMap.put(GoodsRecordNotice.Type_Refund_Stock,TagColor.Processing);
        }
        return noticeTypeMap;
    }
    private static Map<String, TagColor> noticeStatusMap=null;
    public static Map<String, TagColor> getNoticeStatus(){
        if(null==noticeStatusMap){
            noticeStatusMap=new HashMap<>();
            noticeStatusMap.put(GoodsRecordNotice.Status_Notice,TagColor.Processing);
            noticeStatusMap.put(GoodsRecordNotice.Status_Read,TagColor.Success);
            noticeStatusMap.put(GoodsRecordNotice.Status_Delete,TagColor.Default);
        }
        return noticeStatusMap;
    }
    private static Map<String, TagColor> stockTypeMap=null;
    public static Map<String, TagColor> getStockType(){
        if(null==stockTypeMap){
            stockTypeMap=new HashMap<>();
            stockTypeMap.put(StockInfo.Type_Stock,TagColor.Processing);
            stockTypeMap.put(StockInfo.Type_Allocate,TagColor.GeekBlue);
            stockTypeMap.put(StockInfo.Type_Produce,TagColor.Success);
            stockTypeMap.put(StockInfo.Type_Count,TagColor.Warning);
            stockTypeMap.put(StockInfo.Type_Refund,TagColor.Error);
            stockTypeMap.put(StockInfo.Type_Begin,TagColor.Lime);
        }
        return stockTypeMap;
    }
    private static Map<String, TagColor> saleTypeMap=null;
    public static Map<String, TagColor> getSaleType(){
        if(null==saleTypeMap){
            saleTypeMap=new HashMap<>();
            saleTypeMap.put(SaleInfo.Type_Sale,TagColor.Processing);
            saleTypeMap.put(SaleInfo.Type_Produce,TagColor.Success);
            saleTypeMap.put(SaleInfo.Type_Count,TagColor.Warning);
            saleTypeMap.put(SaleInfo.Type_Refund,TagColor.Error);
        }
        return saleTypeMap;
    }
    private static Map<String,TagColor> amountLinkStatusMap=null;
    public static Map<String, TagColor> getAmountLinkStatus(){
        if(null==amountLinkStatusMap){
            amountLinkStatusMap=new HashMap<>();
            amountLinkStatusMap.put(GuestBackAmount.LinkStatus_No,TagColor.Default);
            amountLinkStatusMap.put(GuestBackAmount.LinkStatus_linking,TagColor.Processing);
            amountLinkStatusMap.put(GuestBackAmount.LinkStatus_Done,TagColor.Success);
        }
        return amountLinkStatusMap;
    }
    private static Map<String,TagColor> amountModeMap=null;
    public static Map<String, TagColor> getAmountMode(){
        if(null==amountModeMap){
            amountModeMap=new HashMap<>();
            amountModeMap.put(GuestBackAmount.Mode_Bank,TagColor.Red);
            amountModeMap.put(GuestBackAmount.Mode_Alipay,TagColor.Blue);
            amountModeMap.put(GuestBackAmount.Mode_Wechat,TagColor.Green);
            amountModeMap.put(GuestBackAmount.Mode_Other,TagColor.Cyan);
        }
        return amountModeMap;
    }
    private static Map<String,TagColor> guestTypeMap=null;
    public static Map<String, TagColor> getGuestType(){
        if(null==guestTypeMap){
            guestTypeMap=new HashMap<>();
            guestTypeMap.put(GuestInfo.Type_Company,TagColor.Red);
            guestTypeMap.put(GuestInfo.Type_People,TagColor.Blue);
        }
        return guestTypeMap;
    }
    private static Map<String,TagColor> goodsPropertyMap=null;
    public static Map<String, TagColor> getGoodsProperty(){
        if(null==goodsPropertyMap){
            goodsPropertyMap=new HashMap<>();
            goodsPropertyMap.put(StoreGoods.Property_Goods,TagColor.Blue);
            goodsPropertyMap.put(StoreGoods.Property_Server,TagColor.Red);
        }
        return goodsPropertyMap;
    }

}
